150 PART 4 Comparing Groups
LISTING 11-2:
R Output from a Paired Student t Test
> t.test(BP$BPXOSY1, BP$BPXOSY2, paired = TRUE)
Paired t-test
data: BP$BPXOSY1 and BP$BPXOSY2
t = 4.3065, df = 10325, p-value = 1.674e–05
alternative hypothesis: true mean difference is not equal to 0
95 percent confidence interval:
0.1444651 0.3858467
sample estimates:
mean difference
0.2651559
Notice a difference between the output shown in Listings 11-1 and 11-2. In
Listing 11-1, the third line of output says, “alternative hypothesis: true mean is
not equal to 100.” That is because we specified the null hypothesis of 100 when we
coded the one-sample t test. Because we did a paired t test in Listing 11-2, this
null hypothesis now concerns 0 because we are trying to see if there is a statisti-
cally significant difference between the first SBP reading and the second in the
same individuals. Why should they be very different at all? In Listing 11-2, the p
value is listed as 1.674e–05, which resolves to 0.00001674 (to be stated as p <
0.0001). We were surprised to see a statistically significant difference! The output
says that the 95 percent confidence interval of the difference is 0.1444651 mmHg
to 0.3858467 mmHg, so this small difference may be statistically significant while
not being clinically significant.
Let’s examine the output from our independent t test of mean fasting glucose
values in NHANES participants who were married compared to participants with
all other marital statuses. This output is shown in Listing 11-3.
LISTING 11-3:
R Output from an Independent t Test
> t.test(NHANES$LBXGLU ~ NHANES$MARRIED)
Welch Two Sample t-test
data: NHANES$LBXGLU BY NHANES$MARRIED
t = –4.595, df = 4731.2, p-value = 4.439e–06
alternative hypothesis: true difference in means between group $
95 percent confidence interval:
–6.900665
–2.773287
sample estimates:
mean in group 0 mean in group 1
108.8034
113.6404